package main

import "log"

func main() {
	c := make(chan int, 1)

	go func(c1 chan<- int) {
		for {
			select {
			case c1 <- 0:
			case c1 <- 1:
			}

		}
	}(c)

	for i := 0; i < 10; i++ {
		log.Println(<-c)
	}

}
